package com.baidu.project15.chart25;

public class Banzhang extends Officer{
    public Banzhang(String name){
        super(name);
    }
    @Override
    public void sendMission(Mission mission) {
        //请求满足条件
        if(mission.getEnemyNumber()>0 && mission.getEnemyNumber()<10){
            //处理请求
            //敌人数量＜10，班长下达作战命令
            System.out.println("班长"+name+"接到"+mission.getSoldierName()+"的军情"+"，敌人数量为："+mission.getEnemyNumber()+"，可以下达作战指令");
        }else{
            if(this.officer!=null)
            {
                this.officer.sendMission(mission); //转发请求
            }
        }
    }
}